﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
                    xmlns:gsextra="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WP71"
                    xmlns:interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
                    >
    <DataTemplate x:Key="MenuDataTemplate">
        <StackPanel HorizontalAlignment="Left" Width="480" Orientation="Horizontal" Margin="0,0,0,12">
            <Grid Height="48" Width="48" VerticalAlignment="Top" Margin="0,0,12,0">
                <!--<Rectangle Fill="{StaticResource PhoneAccentBrush}" Height="48" Stroke="{StaticResource PhoneAccentBrush}" Width="48" HorizontalAlignment="Left" d:LayoutOverrides="HorizontalAlignment, VerticalAlignment, Height" VerticalAlignment="Top"/>-->
                <Rectangle Fill="#222b62" Stroke="#222b62" Height="48" Width="48" HorizontalAlignment="Left" VerticalAlignment="Top"/>
                <Image Source="/icons/appbar.movie.clapper.solid.png" Width="48" Height="48" HorizontalAlignment="Left" VerticalAlignment="Top" UseLayoutRounding="True"/>
            </Grid>
            <StackPanel Margin="0,6,0,0">
                <TextBlock  TextWrapping="Wrap" Text="{Binding Name}" FontSize="24"/>
            </StackPanel>
        </StackPanel>
    </DataTemplate>

    <DataTemplate x:Key="StreamItemTemplate">
        <StackPanel Orientation="Horizontal" Margin="0,0,0,12">
            <Image Name="StreamFriendImage"
                       Height="64"
                       Width="64"
                       VerticalAlignment="Top">
                <Image.Source>
                    <BitmapImage UriSource="{Binding Friend.Avatar}" CreateOptions="BackgroundCreation"/>
                </Image.Source>
            </Image>
            <StackPanel Orientation="Vertical" VerticalAlignment="Top" Margin="0,-6,0,0">
                <TextBlock Name="StreamFriendName"
                               Text="{Binding Friend.UserName}"
                               Style="{StaticResource PhoneTextTitle3Style}"
                               Foreground="#222b62"></TextBlock>
                <TextBlock Name="StreamMovieTitleDescr"
                               Text="Latest watched movie"
                               Style="{StaticResource PhoneTextSmallStyle}"></TextBlock>
                <TextBlock Name="StreamMovieTitle"
                               Text="{Binding WatchedMovie.Title}"
                               Style="{StaticResource PhoneTextTitle3Style}"></TextBlock>
                <TextBlock Name="StreamTVShowSeriesNameDesc"
                               Text="Latest watched tv show"
                               Style="{StaticResource PhoneTextSmallStyle}"></TextBlock>
                <TextBlock Name="StreamTVShowSeriesName"
                               Text="{Binding WatchedTVShow.Series_name}"
                               Style="{StaticResource PhoneTextTitle3Style}"></TextBlock>
            </StackPanel>
        </StackPanel>
    </DataTemplate>

    <!-- DepSoftFollwItFramework:ImageExtension.Source="{Binding Cover}" -->
    <DataTemplate x:Key="MovieItemTemplate">
        <StackPanel>
            <!--<Border BorderBrush="{StaticResource PhoneForegroundBrush}" BorderThickness="5" Margin="3" Height="215" Width="140">-->
            <Border BorderBrush="{StaticResource PhoneForegroundBrush}" Margin="3,0,3,0" Height="215" Width="140">
                <Image toolkit:TiltEffect.IsTiltEnabled="True"                           
                           Margin="0"
                           HorizontalAlignment="Center"                           
                           Width="140"
                           Height="210">
                    <Image.Source>
                        <BitmapImage UriSource="{Binding Cover}" CreateOptions="BackgroundCreation"/>
                    </Image.Source>
                    <interactivity:Interaction.Triggers>
                        <interactivity:EventTrigger EventName="Tap">
                            <gsextra:EventToCommand Command="{Binding MainViewModel.MovieItemSelectedCommand, Source={StaticResource Locator}}"
                                                        PassEventArgsToCommand="True"
                                                        CommandParameter="{Binding MovieID}"
                                                        ></gsextra:EventToCommand>
                        </interactivity:EventTrigger>
                    </interactivity:Interaction.Triggers>
                </Image>
            </Border>
            <!--<TextBlock x:Name="MovieID" Text="{Binding MovieID}" Visibility="Collapsed"></TextBlock>-->
        </StackPanel>
    </DataTemplate>

    <!--DepSoftFollwItFramework:ImageExtension.Source="{Binding Cover}"-->
    <DataTemplate x:Key="TVShowItemTemplate">
        <StackPanel>
            <!--<Border BorderBrush="{StaticResource PhoneForegroundBrush}" BorderThickness="5" Margin="3" Height="215" Width="140">-->
            <Border BorderBrush="{StaticResource PhoneForegroundBrush}" Margin="3,0,3,0" Height="215" Width="140">
                <Image x:Name="TVShowCover"
                           toolkit:TiltEffect.IsTiltEnabled="True"
                           Margin="0"
                           HorizontalAlignment="Center"
                           Width="140"
                           Height="210">
                    <Image.Source>
                        <BitmapImage UriSource="{Binding Cover}" CreateOptions="BackgroundCreation"/>
                    </Image.Source>
                    <interactivity:Interaction.Triggers>
                        <interactivity:EventTrigger EventName="Tap">
                            <gsextra:EventToCommand Command="{Binding MainViewModel.TVShowItemSelectedCommand, Source={StaticResource Locator}}"
                                                        PassEventArgsToCommand="True"
                                                        CommandParameter="{Binding TVShowID}"
                                                        ></gsextra:EventToCommand>
                        </interactivity:EventTrigger>
                    </interactivity:Interaction.Triggers>
                </Image>
            </Border>
            <!--<TextBlock x:Name="MovieID" Text="{Binding MovieID}" Visibility="Collapsed"></TextBlock>-->
        </StackPanel>
    </DataTemplate>
</ResourceDictionary>